package com.ruoyi.user.domain;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 退款信息实体类
 *
 * @author houyong
 */
@EqualsAndHashCode
@Schema(name = "RefundInfo", description = "退款信息")
public class RefundInfo {

    @Schema(description = "主键ID")
    private Integer id;
    
    @Schema(description = "退款金额（分）")
    private Integer amount; //退款金额　　分
    
    @Schema(description = "退款描述")
    private String description;
    
    @Schema(description = "操作员UID")
    private String operatorUid;
    
    @Schema(description = "订单ID")
    private String orderId;
    
    @Schema(description = "退款金额（元）")
    private BigDecimal pay;  //退款金额　元
    
    @Schema(description = "退款类型")
    private String refundType;
    
    @Schema(description = "响应结果")
    private String reponseResult;
    
    @Schema(description = "退款状态")
    private String status;
    
    @Schema(description = "是否成功")
    private Boolean succeed;
    
    @Schema(description = "创建时间")
    private Long t;
    
    @Schema(description = "退款成功时间")
    private Long timeSucceed;
    
    @Schema(description = "交易号")
    private String tradeNo;
    
    @Schema(description = "商户退款单号")
    private String outRequestNo;
    
    @Schema(description = "退款ID")
    private String refundId;

    public RefundInfo() {
    }

    public RefundInfo(Integer amount, String description, String operatorUid, String orderId, BigDecimal pay, String refundType, String reponseResult, String status, Boolean succeed, Long t, Long timeSucceed, String tradeNo, String outRequestNo, String refundId) {
        this.amount = amount;
        this.description = description.trim();
        this.operatorUid = operatorUid;
        this.orderId = orderId;
        this.pay = pay;
        this.refundType = refundType;
        this.reponseResult = reponseResult;
        this.status = status;
        this.succeed = succeed;
        this.t = t;
        this.timeSucceed = timeSucceed;
        this.tradeNo = tradeNo;
        this.outRequestNo = outRequestNo;
        this.refundId = refundId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getOperatorUid() {
        return operatorUid;
    }

    public void setOperatorUid(String operatorUid) {
        this.operatorUid = operatorUid;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public BigDecimal getPay() {
        return pay;
    }

    public void setPay(BigDecimal pay) {
        this.pay = pay;
    }

    public String getRefundType() {
        return refundType;
    }

    public void setRefundType(String refundType) {
        this.refundType = refundType;
    }

    public String getReponseResult() {
        return reponseResult;
    }

    public void setReponseResult(String reponseResult) {
        this.reponseResult = reponseResult;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Boolean getSucceed() {
        return succeed;
    }

    public void setSucceed(Boolean succeed) {
        this.succeed = succeed;
    }

    public Long getT() {
        return t;
    }

    public void setT(Long t) {
        this.t = t;
    }

    public Long getTimeSucceed() {
        return timeSucceed;
    }

    public void setTimeSucceed(Long timeSucceed) {
        this.timeSucceed = timeSucceed;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public String getOutRequestNo() {
        return outRequestNo;
    }

    public void setOutRequestNo(String outRequestNo) {
        this.outRequestNo = outRequestNo;
    }

    public String getRefundId() {
        return refundId;
    }

    public void setRefundId(String refundId) {
        this.refundId = refundId;
    }

    /**
     * 退款状态
     */
    @Schema(description = "退款状态枚举")
    public enum RefundStatus {
        SUCCEEDED("succeeded"), PENDING("pending"), FAILED("failed");
        private String value;

        RefundStatus(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }
    }

    /**
     * 退款 类别
     */
    @Schema(description = "退款类别枚举")
    public enum RefundCategory {

        /**
         * 退款 原路返回
         */
        BACKTRACK(1),
        /**
         * 走转账的方式 退款
         */
        TRANSFERACCOUNT(2);

        private Integer value;

        RefundCategory(Integer value) {
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }

        public void setValue(Integer value) {
            this.value = value;
        }
    }


}